<%include file="header.mako" />
<%namespace name="app" file="tuttfuncs.mako"/>
<script>
</script>
</head>
<body class="container_16">
<div class="grid_16">
<h2 class="cc">Colorado College</h2>
<%
  import datetime
  today = datetime.datetime.today()
%>
<h1>Tutt Library Systems - ${today.strftime('%B %d, %Y')}</h1>
</div>
<div class="clear"></div>
<div class="grid_10">
<h2>Tutt Library System Projects</h2>
<table id="projects-table">
 <tr>
  <th>Project Name</th>
  <th>Started on</th>
  <th>Scheduled finish</th>
  <th>Number of tasks</th>
  <th>Status</th>
 </tr>
 % for i,project in enumerate(listing):
 % if not i%2:
 <tr>
 % else:
 <tr class="alt">
 % endif
  <td><a href="/project?id=${project.key()}">${project.name}</a></td>
  <td>${project.start_date.strftime('%m-%d-%Y')}</td>
  <td>${project.end_date.strftime('%m-%d-%Y')}</td>
  <td>${len(project.get_tasks())}</td></td>
  <td>
  <%
    project_status = project.get_status()['msg']
  %>
  % if project_status == 'Late':
  <span style="color:red">Late</span>
  % else:
  <span>${project_status}</span>
  % endif
  </td>
 </tr>
 % endfor
</table>
</div>
<div class="grid_6">
<h2>Visualizations</h2>
<ul>
 <li><a href="/ganett">Simplified Ganett Chart</a></li>
</ul>
<br/>
<h2>Contact</h2>
<p>
Jeremy Nelson<br/>
Meta-data and Systems Librarian<br/>
<a href="mailto:jeremy.nelson@coloradocollege.edu">jeremy.nelson@coloradocollege.edu</a><br/>
(719) 389-6895
</p>
</div>
<div class="clear"></div>
<div class="grid_16">&nbsp;</div>
<div class="clear"></div>
<div class="grid_16">
<h2>Library Systems</h2>
<table id="systems-table">
<tr>
 <th>Name</th>
 <th>External URL</th>
 <th>Code Repository</th>
% if user:
 <th>Actions</th>
% endif 
 <th>Status</th>
</tr>
% for i,system in enumerate(lib_systems):
% if not i%2:
<tr class="alt">
% else:
<tr>
% endif
 <td>${system.name}</td>
 <td><a href="${system.url}">${system.url}</a></td>
 <td>
 % if system.src_repository_url:
 <a href="${system.src_repository_url}">Link</a>
 % else:
 None
 % endif
 </td>
 % if user:
 <td><button onclick="EditSystem('${system.key()}')">Edit</button></td>
 % endif
 <td><span style="color:#dcba00;font-weight:bold" id="${system.key()}"><blink>Checking...</blink></span></td>
</p>
% endfor 
</table>
</div>
<div class="clear"></div>
<div id="sys-dlg">
 <input type="hidden" id="sys-key" value="" />
 <label>Name:</label> <input id="sys-name" size="45" /><br/>
 <label>URL:</label> <input id="sys-url" size="60" /><br/>
 <label>Repo:</label> <input id="sys-repo" size="60" /><br/>
 <button onclick="SaveSystem()">Save</button>
 <button onclick="$('#sys-dlg').dialog('close')">Cancel</button>
</div>
<script type="text/javascript">
 $(function(){
   $('#sys-dlg').dialog({ autoOpen: false,
                             title: "Update System Info",
                            height: 220,
                             width: 640 });

 });
 var systems = new Array();
 % for r in lib_systems:
 systems.push('${r.key()}');
 % endfor
 CheckSystems(systems);
</script>
<%include file="footer.mako" />
